package com.lagou.homework4;

public class TicketTest {
    public static void main(String[] args) {
        TicketerBunker bunker = new TicketerBunker();
        bunker.setTickets(100);
//        1.使用runnable
        Thread buyers1 = new Thread(new TicketBuyers("buyers1", bunker)) ;
//        Thread buyers2 = new Thread(new TicketBuyers("buyers2", bunker)) ;
//        Thread buyers3 = new Thread(new TicketBuyers("buyers3", bunker)) ;
//        buyers1.start();
//        buyers2.start();
//        buyers3.start();

//        2.使用Thread
        Thread tbuyser1 = new ThreadTicketBuyers("tbuyser1",bunker);
        Thread tbuyser2 = new ThreadTicketBuyers("tbuyser2",bunker);
        Thread tbuyser3 = new ThreadTicketBuyers("tbuyser3",bunker);
        tbuyser1.start();
        tbuyser2.start();
        tbuyser3.start();

    }
}
